package cn.manyufun.myf.api;


import java.util.Map;

import cn.manyufun.myf.bean.ArticleListBean;
import cn.manyufun.myf.bean.BaseBean;
import cn.manyufun.myf.bean.ComicsDetailBean;
import cn.manyufun.myf.bean.ComicsListBean;
import cn.manyufun.myf.bean.FollowListBean;
import cn.manyufun.myf.bean.GetReplyBean;
import cn.manyufun.myf.bean.HotArticlesBean;
import cn.manyufun.myf.bean.ImageUploadBean;
import cn.manyufun.myf.bean.LoginBean;
import cn.manyufun.myf.bean.NewsSummaryList;
import cn.manyufun.myf.bean.PosterBean;
import cn.manyufun.myf.bean.RegisterBean;
import cn.manyufun.myf.bean.ReplyListBean;
import cn.manyufun.myf.bean.SearchBean;
import cn.manyufun.myf.bean.UserDetail;
import cn.manyufun.myf.bean.VerifyCodeBean;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import rx.Observable;

/**
 * des:ApiService
 * <p>
 * on 2016.06.15:47
 */
public interface ApiService {
    @POST("Poster/List/")
    Observable<PosterBean> getPosterList();

    @POST("News/List/")
    Observable<NewsSummaryList> getNewsList(
            @Body RequestBody requestBody
    );


    @POST("News/Recommend/")
    Observable<ComicsListBean> getNewsRecommend(
            @Body RequestBody requestBody

    );

    @POST("News/RecommendForYou/")
    Observable<FollowListBean> getNewsRecommendForYou(
            @Body RequestBody requestBody

    );

    @POST("News/HotList/")
    Observable<FollowListBean> getHotList(
            @Body RequestBody requestBody

    );

    @POST("News/RankList/")
    Observable<FollowListBean> getRankList(
            @Body RequestBody requestBody

    );

    @POST("News/Search/")
    Observable<SearchBean> search(
            @Body RequestBody requestBody

    );

    @POST("User/FollowList/")
    Observable<FollowListBean> getFollowList(
            @Body RequestBody requestBody
    );

    @POST("User/Detail/")
    Observable<UserDetail> getUserDetail(
            @Body RequestBody headInfo
    );

    @POST("User/Follow/")
    Observable<BaseBean> followComics(
            @Body RequestBody requestBody
    );

    @POST("User/Like/")
    Observable<BaseBean> like(
            @Body RequestBody requestBody
    );

    @POST("User/SendCode/")
    Observable<VerifyCodeBean> sendCode(
            @Body RequestBody requestBody
    );

    @POST("User/Register/")
    Observable<RegisterBean> register(
            @Body RequestBody requestBody
    );

    @POST("User/Login/")
    Observable<LoginBean> login(
            @Body RequestBody requestBody
    );

    @POST("User/Modify/")
    Observable<BaseBean> modifyUser(
            @Body RequestBody requestBody
    );

    @Multipart
    @POST("User/UpdateUser/")
    Observable<BaseBean> updateUser(
            @Part("UserToken") String UserToken,
            @Part("NickName") String NickName,
            @Part("Gender") int Gender,
            @Part("Birthday") String Birthday,
            @Part("Region") String Region,
            @Part("Slogan") String Slogan,
            @Part MultipartBody.Part photo
    );

    @Multipart
    @POST("User/UpdateUser/")
    Observable<BaseBean> updateUserMap(
            @PartMap Map<String, RequestBody> params,
            @Part MultipartBody.Part photo
    );
    //            @Query("UID") String UID,
//            @Query("NickName") String NickName,
//            @Query("Gender") int Gender,
//            @Query("Birthday") String Birthday,
//            @Query("Region") String Region,
//            @Field("Slogan") String Slogan,
    @POST("Comic/Detail/")
    Observable<ComicsDetailBean> getComicsDetail(
            @Body RequestBody requestBody
    );

    @POST("Comic/HotArticles/")
    Observable<HotArticlesBean> getHotArticles(
            @Body RequestBody requestBody
    );

    @POST("Comic/Reply/")
    Observable<BaseBean> setCommentReply(
            @Body RequestBody requestBody
    );

    @POST("Comic/GetReply/")
    Observable<GetReplyBean> getCommentReplyById(
            @Body RequestBody requestBody
    );

    @POST("Comic/ReplyList/")
    Observable<ReplyListBean> getComicsReplyList(
            @Body RequestBody requestBody
    );

    @POST("Article/New/")
    Observable<BaseBean> setArticleNew(
            @Body RequestBody requestBody
    );

    @POST("Article/List/")
    Observable<ArticleListBean> getArticleListByComics(
            @Body RequestBody requestBody
    );

    @POST("Article/Reply/")
    Observable<BaseBean> setArticleReply(
            @Body RequestBody requestBody
    );

    @POST("Article/ReplyList/")
    Observable<ReplyListBean> getArticleReplyList(
            @Body RequestBody requestBody
    );

    @Multipart
    @POST("Article/Create/")
    Observable<ReplyListBean> articleCreate(
            @PartMap Map<String, RequestBody> params,
            @Part MultipartBody.Part photo
    );

    @Multipart
    @POST("Image/UploadImage/")
    Observable<ImageUploadBean> imageUpload(
            @Part MultipartBody.Part imgs
    );
}
